﻿

namespace LxCFD
{
    public class RhieChowInterpolation
    {
        protected Vector3d[] Dc;

        protected double[] Pressure;
        protected Vector3d[] PressureGrad;

        public void SetParameter(PressureCorrectionBasic pressureCorInSIMPLE, PressureSIMPLE pressureInSIMPLE)
        {
            this.Dc = pressureCorInSIMPLE.Dc;

            this.Pressure = pressureInSIMPLE.x;
            this.PressureGrad = pressureInSIMPLE.Grad;
        }

        public virtual Vector3d CalVelocityCorrection_Inner(int faceID, ref FvFace face)
        {
            return Vector3d.XXYYZZProduct(face.CalAverage(Dc), -face.CalCFGradCorrection_inner(PressureGrad, Pressure));//Dc改为不包含松弛的了，因此直接用公式
        }
        public virtual Vector3d CalVelocityCorrection_Bound(int faceID, ref FvFace face)
        {
            return Vector3d.XXYYZZProduct(Dc[face.OSideCell], -face.CalCFGradCorrection_bound(PressureGrad, Pressure));
        }
    }
}
//public virtual void UpdateParameter(VelocityVector.TransientVelRecorder velRecorder)
//{

//}